function getOCRWithUrl(imageUrl, type, successBlock) {
	var mainUrl = ''
	var parameString = {}
	if (type == 1) { // 身份证
		 mainUrl = "https://aiperson.market.alicloudapi.com/ai_market/ai_ocr_universal/shen_fen_zheng/v1";
		 parameString = {
		'IMAGE' : imageUrl,
		'IMAGE_TYPE' : 1
	}
	}else if (type == 2) { // 银行卡识别
		mainUrl = 'https://bankid.market.alicloudapi.com/ai-market/ocr/ai-bank-card'
		parameString = {
			'AI_BANKCARD_IMAGE' : imageUrl,
			'AI_BANKCARD_IMAGE_TYPE' : 1
		}
	}else if (type == 3) { // 营业执照识别
		mainUrl = 'https://blicence.market.alicloudapi.com/ai_business_license'
		parameString = {
			'AI_BUSINESS_LICENSE_IMAGE' : imageUrl,
			'AI_BUSINESS_LICENSE_IMAGE_TYPE' : 1
		}
	}else if (type == 4) { // 开户许可
		mainUrl = 'http://blisence.market.alicloudapi.com/ai_market/ai_ocr_universal/internet_pub/v1'
		parameString = {
			'IMAGE' : imageUrl,
			'IMAGE_TYPE' : 1
		}
	}
	var appcode = 'b8dac3b2db6745bda3e925f65a2c0b8d'
	uni.showLoading({
		title: "正在识别...",
		mask: true
	})
	uni.request({
		url: mainUrl,
		method: 'POST',
		data: parameString,
		header: {
			'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
			'Authorization': 'APPCODE ' + appcode
		},
		success: res => {
			uni.hideLoading();
			successBlock(res.data)
		},
		fail: ress => {
			uni.hideLoading();
		},
		complete: () => {}
	});
}

module.exports = {
	getOCRWithUrl
}